<?php
/* @var $this ProductsController */
/* @var $data Products */
?>

<div class="view">
    <?php $operator = Category::model()->findAll(); ?>
    
    <div>
        <span><b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b></span>
	<!--<span><?php echo CHtml::link(CHtml::encode($data->id), array('viiiiew', 'id'=>$data->id)); ?></span>-->
        <span><?php echo CHtml::link(CHtml::encode($data->id), array(Yii::app()->request->baseUrl, 'id'=>$data->id)); ?></span>
        <span><?php echo Yii::app()->request->baseUrl."/"; ?></span>
        
        <?php echo CHtml::link("Link", array(Yii::app()->controller->getId()."/".Yii::app()->controller->getAction()->getId())); ?>
        <br /><br /><br /><br />
        <?php echo CHtml::link('Link Text',array('controller/action')); ?>
    </div>

    <div>
	<span><b><?php echo CHtml::encode($data->getAttributeLabel(Yii::t('app', 'Product Name'))); ?>:</b></span>
	<span><?php echo CHtml::encode($data->nomeProdotto); ?></span>
    </div>

    <div>
	<span><b><?php echo CHtml::encode($data->getAttributeLabel(Yii::t('app', 'Quantity'))); ?>:</b></span>
	<span><?php echo CHtml::encode($data->quantita); ?></span>
    </div>

    <div>
	<span><b><?php echo CHtml::encode($data->getAttributeLabel(Yii::t('app', 'Description'))); ?>:</b></span>
	<span><?php echo CHtml::encode($data->descrizione); ?></span>
    </div>

    <div>
	<span><b><?php echo CHtml::encode($data->getAttributeLabel(Yii::t('app', 'Category'))); ?>:</b></span>
	<!--<?php echo CHtml::encode($data->category_id); ?>-->
        <span>
            <?php 
                foreach(CHtml::listData($operator, 'id', 'category') as $key => $value){
                    if($data->category_id == $key) echo $value;
                }
            ?>
        </span>
    </div>
</div>